<template>
	<view>
		<view class="wrap">
		            <form @submit="formSubmit" >
		                <view class="uni-form-item uni-column">
		                    <view class="title">申请人</view>
							<view class="ff">
								{{detailData.pplyUserName}}
							</view>
		                    <!-- <input class="uni-input" name="input" :value="detailData.pplyUserName" /> -->
		                </view>
						<view class="uni-form-item uni-column">
						    <view class="title">科室</view>
						    <input class="uni-input" name="input" :value="detailData.applyPartmentName" disabled="true"/>
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">用车人</view>
						    <input class="uni-input" name="input" :value="detailData.passengers[0].name" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">申请时间</view>
						    <input class="uni-input" name="input" :value="detailData.createTime" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">用车人电话</view>
						    <input class="uni-input" name="input" :value="detailData.passengers[0].tel" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">用车类型</view>
						    <input class="uni-input" name="input" :value="orderType" disabled="true" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">申请编号</view>
						    <input class="uni-input" name="input" :value="detailData.id" disabled="true" />
						</view>
						<view class="applyStatus">
						    <view class="title">申请状态</view>
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">当前状态</view>
						    <input class="uni-input" name="input"  :value="orderStatusText" disabled="true" />
						</view>
						<view class="userStatus">
						    <view class="title">用车明细</view>
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">发车时间</view>
						    <input class="uni-input" name="input" :value="detailData.setoffTime" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">返回时间</view>
						    <input class="uni-input" name="input" :value="detailData.backTime"  />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">乘坐人数</view>
						    <input class="uni-input" name="input" :value="detailData.passengersNum" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">用车数量</view>
						    <input class="uni-input" name="input" :value="detailData.requstCarNum" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">乘车地点</view>
						    <input class="uni-input" name="input" :value="detailData.setoffAddress"/>
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">到达地点</view>
						    <input class="uni-input" name="input" :value="detailData.arrivalAddress" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">用车事由</view>
						    <input class="uni-input" name="input" :value="detailData.applyReason" />
						</view>
						<view class="uni-form-item uni-column">
						    <view class="title">接受拼车</view>
						    <input class="uni-input" name="input" :value="detailData.allowCarpooling == 'yes' ? '是' : '否'" />
						</view>
		                <view class="uni-btn-v">
		                    <button form-type="submit">确定修改</button>
		                    <!-- <button type="default" form-type="reset">Reset</button> -->
		                </view>
		            </form>
		        </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token:'',
				detailData: {}
			}
		},
		onLoad() {
		   let token = uni.getStorageSync('userinfo').token
		   this.token = token
		   console.log(token)
		   let detailData = uni.getStorageSync('detailData')
		   console.log(detailData)
		},
		methods: {
			   formSubmit: function(e) {
			        console.log('form发生了submit事件，携带数据为：' + JSON.stringify(e.detail.value))
			        var formdata = e.detail.value
			        uni.showModal({
			            content: '表单数据内容：' + JSON.stringify(formdata),
			            showCancel: false
			        });
			    }
		}
	}
</script>

<style>
 @import url("./updataOrder.css");
</style>
